package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbSpuMapper;
import com.ruoyi.system.domain.TbSpu;
import com.ruoyi.system.service.ITbSpuService;

/**
 * SPUService业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-01
 */
@Service
public class TbSpuServiceImpl implements ITbSpuService 
{
    @Autowired
    private TbSpuMapper tbSpuMapper;

    /**
     * 查询SPU
     * 
     * @param id SPU主键
     * @return SPU
     */
    @Override
    public TbSpu selectTbSpuById(Integer id)
    {
        return tbSpuMapper.selectTbSpuById(id);
    }

    /**
     * 查询SPU列表
     * 
     * @param tbSpu SPU
     * @return SPU
     */
    @Override
    public List<TbSpu> selectTbSpuList(TbSpu tbSpu)
    {
        return tbSpuMapper.selectTbSpuList(tbSpu);
    }

    /**
     * 新增SPU
     * 
     * @param tbSpu SPU
     * @return 结果
     */
    @Override
    public int insertTbSpu(TbSpu tbSpu)
    {
        return tbSpuMapper.insertTbSpu(tbSpu);
    }

    /**
     * 修改SPU
     * 
     * @param tbSpu SPU
     * @return 结果
     */
    @Override
    public int updateTbSpu(TbSpu tbSpu)
    {
        return tbSpuMapper.updateTbSpu(tbSpu);
    }

    /**
     * 批量删除SPU
     * 
     * @param ids 需要删除的SPU主键
     * @return 结果
     */
    @Override
    public int deleteTbSpuByIds(Integer[] ids)
    {
        return tbSpuMapper.deleteTbSpuByIds(ids);
    }

    /**
     * 删除SPU信息
     * 
     * @param id SPU主键
     * @return 结果
     */
    @Override
    public int deleteTbSpuById(Integer id)
    {
        return tbSpuMapper.deleteTbSpuById(id);
    }
}
